<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app"></div>

    <script type="text/javascript" src="../js/react.development.js"></script>
    <script type="text/javascript" src="../js/react-dom.development.js"></script>
    <script type="text/javascript" src="../js/babel.min.js"></script>
    
    <script type="text/babel">
        // 假数据
        const obj = {name:"张三",age:18,sex:"男"}
        // 创建组件
        class Persion extends React.Component {
            render() {
                const {name,age,sex} = this.props
                return (
                    <div>
                        <h1>{name}</h1>
                        <h2>{age}</h2>
                        <h2>{sex}</h2>
                    </div>
                )
            }
        }
        // 渲染组件
        // ReactDOM.render(<Persion name="zhangsan" age="18" sex="1"/>,document.querySelector('#app'))
        // 批量传递props/批量传递标签属性
        ReactDOM.render(<Persion {...obj}/>,document.querySelector('#app'))
    </script>
</body>
</html>